<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1,minimum-scale=1, maximum-scale=1, user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title><%= title %></title>
    <link rel='stylesheet' href='/css/style.css' />
  </head>
  <body>
  <%if(result.length>0){%>
    <form action="edit" method="post">
      <div class="">
        <%for (var i=0;i<result.length;i++){%>
        <input type="hidden" placeholder="用户名" name="id" value="<%-result[i].id -%>">
        <input type="text" placeholder="用户名" name="userName" value="<%-result[i].userName -%>">
        <input type="password" placeholder="密码" name="passWord" value="<%-result[i].passWord -%>">
          <input type="text" placeholder="呢称" name="nickName" value="<%-result[i].nickName -%>">
          <select name="sex">

              <option <%if(result[i].sex=='女'){%> selected <%}%> value="女">女</option>
              <option <%if(result[i].sex=='男'){%> selected <%}%> value="男">男</option>
          </select>
        <%}%>
   <%}else{%>
        <form action="add" method="post">
          <div class="">
            <input type="text" placeholder="用户名" name="userName">
            <input type="password" placeholder="密码" name="passWord">
              <input type="text" placeholder="呢称" name="nickName">
              <select name="sex">
                  <option value="女">女</option>
                  <option value="男">男</option>
              </select>
        <%}%>
            <button type="submit">提交</button>
          </div>
        </form>
  </body>
</html>
